<%@ page pageEncoding="utf-8" %>
<%@include file="/commons/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<fmt:bundle basename="res">
<head>
    <meta charset="utf-8">
    <title><fmt:message key='bdyj' /></title>
    <jsp:include page="/WEB-INF/commons/commons-header.jsp" flush="true"/>
    <style>
        html {
            background: #fff;
        }

        .layui-form-label {
            width: 150px;
        }

        .layui-input-block {
            margin-left: 180px;
        }
    </style>
</head>

<body>

<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">

    <ul class="layui-tab-title">
        <li class="layui-this"><fmt:message key='fxbd' /></li>
        <li>修改记录</li>
    </ul>

    <div class="layui-tab-content" style="height: 100%;">
        <div class="layui-tab-item layui-show">
            <div class="layui-container">
                <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list"
                     style="padding: 20px 30px 0 0;">
                    <div class="layui-form-item">
                        <label class="layui-form-label"><fmt:message key='fxbdbl' /></label>
                        <div class="layui-inline">
                            <div class="layui-input-inline">
                                <input type="text" class="layui-input" id="scale" value="${scale}">
                            </div>
                            <div class="layui-form-mid">%</div>
                        </div>
                        <div class="layui-input-block"><fmt:message key='fxgongsi' /></div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"></label>
                        <div class="layui-input-inline">
                            <input type="button" value="<fmt:message key='qd' />" id="submit" class="layui-btn">
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-tab-item" style="height: 800px;">
            <iframe src="${web_domain}/distributor/record" style="width:100%;height: 100%;"
                    frameborder="0"></iframe>
        </div>

    </div>
</div>


<script>

    layui.use(['form', 'layer'], function () {

        var layer = layui.layer;
        var form = layui.form;


        $("#submit").click(function () {

            var scale = $("#scale").val();
            if (!scale) {
                layer.msg("<fmt:message key='sryjbl' />");
                return;
            }

            if (isNaN(scale)) {
                layer.msg("<fmt:message key='srzqsz' />");
                return;
            }

            feijin.put({
                url: "${web_domain}/distributor/modifyGuaranteeScale",
                data: {scale: parseInt(scale)},
                success: function (res) {
                    if (res.status) {
                        layer.msg("<fmt:message key='bccg' />");
                    } else {
                        layer.alert(res.message);
                    }
                }
            })

        });

    });

</script>
</body>
</fmt:bundle>
</html>